import 'package:flutter_eve_plugin/model/ye_xiu/rank/rank_info.dart';

class RankState {
  final BaseRankState coinRankState;
  final BaseRankState weaponRankState;
  final BaseRankState roleRankState;
  final BaseRankState abilityRankState;

  RankState({
    this.weaponRankState,
    this.coinRankState,
    this.roleRankState,
    this.abilityRankState,
  });

  RankState copyWith({coinData, weaponData, roleData,abilityData}) {
    return RankState(
      coinRankState: coinData ?? this.coinRankState,
      weaponRankState: weaponData ?? this.weaponRankState,
      roleRankState: roleData ?? this.roleRankState,
      abilityRankState: abilityData ?? this.abilityRankState,
    );
  }

  static RankState initialState() {
    return RankState(
      coinRankState: BaseRankState.initialState(),
      weaponRankState: BaseRankState.initialState(),
      roleRankState: BaseRankState.initialState(),
      abilityRankState: BaseRankState.initialState(),
    );
  }
}

class BaseRankState {
  final List<RankUser> rankUserList;
  final SelfRank selfRank;

  BaseRankState({this.rankUserList, this.selfRank});

  static BaseRankState initialState() {
    return BaseRankState(
        rankUserList: List<RankUser>(),
        selfRank:SelfRank(-1,-1, RankUser(-1, "'", "", 0, 0, 0,0)));
  }
}
